<?php
namespace app\admin\controller;
use \think\Controller;
use \think\Db;
use \think\Loader;
class User extends Controller
{
    public function index()
    {
        $userData = Db::table('user')->paginate(1);
        // var_dump($userData);
        return $this->fetch('',['userData'=>$userData]);
    }

    public function status()
    {
        $uid = input('uid');
        $status = Db::table('user')->where(['uid'=>$uid])->value('status');
        if ($status) {
            $res = Db::table('user')->where(['uid'=>$uid])->update(['status'=>'0']);
        }else{
            $res = Db::table('user')->where(['uid'=>$uid])->update(['status'=>'1']);
        }
    }

}


?>